<script setup lang="ts">
import SvgIcon from "@/components/common/SvgIcon.vue";
import {computed} from "vue";
const props = defineProps({
  isSelected:{
    type:Boolean,
    default:false
  }
})
const emit = defineEmits(['update:isSelected'])
const isSelected = computed({
  get:()=>props.isSelected,
  set:(val)=>{
    emit('update:isSelected',val)
  }
})
</script>

<template>
  <div class="select-button" @click="isSelected=!isSelected">
    <SvgIcon v-if="isSelected" icon-class="input-选中" class-name="icon" />
    <SvgIcon v-else icon-class="input-未选中" class-name="icon" />
  </div>
</template>

<style scoped lang="less">
.select-button{
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  .icon{
    width: 16px;
    height: 16px;
  }
}
</style>
